Conventionally, a video game has been known, in which a virtual object moving in a virtual space is displayed from a viewpoint that follows the virtual object.
In such a video game, a game field in the virtual space is, for example, a dungeon formed of a ground, and objects such as walls that partition the ground. A player object moves on the ground in the dungeon with its movement being restricted by the objects such as walls. A player is provided with, as a game image, an image in which the game field and the player object are viewed from a viewpoint that follows the player object, for example. If the player object is hidden behind another object, a mark indicating the position of the player object is additionally displayed in the game image.
As video games are more sophisticated and complicated, diversification of game fields is also demanded. Further, when a game field is diversified, it is important to maintain and improve visibilities of the game field, a player object, and the like in a game image.
Therefore, an object of the exemplary embodiment is to realize diversification of a game field while maintaining appropriate visibilities of the game field and a player object.
In order to achieve the above object, for example, the following configuration examples are exemplified.
A configuration example is a non-transitory computer-readable storage medium having stored thereon an information processing program which causes a computer of an information processing apparatus which controls display of a virtual object located in a virtual space to operate as: an object control section configured to control movement of the virtual object in a first state and a second state by performing, based on a predetermined condition, switching between the first state in which a region where the virtual object is movable in the virtual space is restricted to a first region, and the second state in which a region where the virtual object is movable in the virtual space is restricted to a second region different from the first region; an image generation section configured to generate an image taken by a virtual camera located in the virtual space; and a virtual camera control section configured to set, in the first state, the position of the virtual camera to a first viewpoint that is a high-angle viewpoint with respect to the first region, and set, in the second state, the position of the virtual camera to a second viewpoint that is a viewpoint other than the high-angle viewpoint. The predetermined condition includes a condition different from a condition that the virtual object moves in the region where the virtual object is movable, in at least one of switching from the first state to the second state and switching from the second state to the first state.
The object control section may switch the virtual object to different virtual objects in the first state and the second state, respectively.
The different virtual objects may be different from each other in at least one of shape, color, and pattern.
The different virtual objects may be a virtual object having a three-dimensional shape in the first state, and a virtual object having a planar shape in the second state.
When the object control section performs switching between the first state and the second state, the virtual camera control section may gradually change the position of the virtual camera between the first viewpoint and the second viewpoint.
When the object control section performs switching between the first state and the second state, the virtual camera control section may gradually change the direction of the virtual camera between the direction thereof at the first viewpoint and the direction thereof at the second viewpoint.
The image generation section may generate, as the image taken from the first viewpoint by the virtual camera, an image obtained by taking a wider region in the virtual space, as compared to an image taken from the second viewpoint by the virtual camera.
The virtual camera control section may set the first viewpoint and the second viewpoint so that the distance between the second viewpoint and the virtual object is shorter than the distance between the first viewpoint and the virtual object.
The object control section may control movement of the virtual object, based on a movement instruction input performed by a user, which instructs movement of the virtual object in the first region and the second region. At least one of the switching from the first state to the second state and the switching from the second state to the first state may be performed based on a switching instruction input performed by a user, which instructs the switching.
The switching instruction input may be an input different from the movement instruction input.
The first region and the second region may be perpendicular to each other in the virtual space.
The virtual camera control section may set the direction of the virtual camera at the second viewpoint so that an amount of change in a left/right direction of the virtual camera with respect to the virtual space is equal to or smaller than a predetermined angle, in a case where the position of the virtual camera is switched from the first viewpoint to the second viewpoint.
The virtual camera control section may set, in the second state, the second viewpoint based on a moving path along which the virtual object is scheduled to move.
The moving path may be specified based on the shape of the second region.
The moving path may be specified based on the shape of a region within a predetermined distance along the second region from the virtual object, the region being included in the second region.
The virtual camera control section may set the second viewpoint, based on at least the direction of a surface of a region along which the moving path extends, the region being included in the second region.
The virtual camera control section may set the second viewpoint, based on at least the length of the moving path along a region along which the moving path extends, the region being included in the second region.
The information processing program can be stored in any non-transitory computer-readable storage medium (e.g., a flexible disc, a hard disk, an optical disc, a magneto-optical disc, a CD-ROM, a CD-R, a magnetic tape, a semiconductor memory card, a ROM, a RAM, etc.).
According to the configuration example, it is possible to realize diversification of a game field while maintaining appropriate visibilities of the game field and a player object.